A computer uses time sources to control and regulate operations, and a computer's operating system, typically, is programmed to interface with these time sources to track time and schedule periodic events. To track time, the operating system may increment current time (also called wall-clock or absolute time) when a periodic timer interrupt is received. Such periodic timer interrupts often are referred to as ticks, and this method of time keeping is known as tick counting. The wall-clock time then may be maintained by a real-time clock, such as a hardware time register. Computers commonly use multiple such registers: a battery-backed clock (register) to maintain time (in seconds, minutes, hours, date) even when the computer is powered off; and another clock to provide higher resolution time when the computer is powered on. At boot up, the operating system reads the wall-clock time stored in the battery-backed clock and uses that information to determine the current wall-clock time. Subsequently, some operating systems may use only the register with higher time resolution.
Maintaining a real-time clock using a high-resolution register works well as long as the register remains a credible time source. By definition, a time source is credible if an operating system or application cannot notice inconsistencies (e.g., time running backwards or moving forward by an unacceptably large amount). A time-disrupting event causes the passage of time to present such time-related inconsistencies in the context of operation of a virtual machine. In contrast, high-resolution time sources for physical machine implementations typically are guaranteed to remain credible at all times.
Virtual machines are logical implementations of a predefined computer architecture. A virtual machine is capable of executing software (applications and operating systems) designed for the predefined computer architecture, although the method of implementation in the virtual machine may be entirely different from that in the physical machine. Common implementations of virtual machines include software or hardware emulating the original computer architecture. Software executing in a “guest” or virtual machine is generally called “guest software” (for example, “guest operating system”). By contrast, the physical machine containing the virtual machine is generally called the “host,” and may be running its own “host software” (for example, “host operating system”).
A common operating scenario involving virtual machines is called “on-line migration,” where a virtual machine running on one host is sent to another host, without, except for perhaps a brief suspension period, interrupting the software or operating system running in the virtual machine. The host on which the virtual machine originally executed is called the “original host.” The host on which the virtual machine ran before the migration is called the “source” of the migration, whereas the host where the virtual machine resides after migration is called the “target.” Note that the source may or may not be the original host. During part of the period of the migration, execution of the virtual machine may be suspended, or “frozen,” to be “thawed” after the migration. The amount of time during which the virtual machine is frozen, i.e. not executing, is called “missing time.”
In the on-line migration scenario, time disruption occurs when time sources on the first physical machine (i.e., the original host) do not match those on the target physical machine. Time values reported by these time sources to a guest might leap forward or backward, or might be measured using different frequencies. Additionally, since the guest operation may be “frozen” for a time as it is being migrated, upon “thawing” at the target, the guest operation would detect a sudden leap forward of time. Such a time disruption or discontinuity may trigger time-out detection code in the guest operation, which in turn could cause a variety of software errors or aborts.